package com.wz.compiler.ArrayInit;

import org.antlr.v4.runtime.*;
import org.antlr.v4.runtime.tree.ParseTree;
import org.antlr.v4.runtime.tree.ParseTreeWalker;

import java.io.IOException;
import java.util.List;

public class ArrayInitTest {

    public static void main(String[] args) throws IOException {
        System.out.println("plz input:");

        CharStream input = CharStreams.fromStream(System.in);
        ArrayInitLexer lexer = new ArrayInitLexer(input);
        CommonTokenStream tokens = new CommonTokenStream(lexer);
        ArrayInitParser parser = new ArrayInitParser(tokens);

        ArrayInitParser.InitContext initContext = parser.init();

//        System.out.println(initContext.toStringTree());

        ParseTreeWalker walker = new ParseTreeWalker();

        walker.walk(new ShortToUnicodeString(), initContext.getRuleContext());
        System.out.println("\n");
    }

}